package com.dib.neo.bkfs.fs;

import java.io.IOException;
import java.io.InputStream;

public class BKFSInputStream extends InputStream {

  private final  BKFile file;

  public BKFSInputStream(BKFile file) {
    this.file = file;
  }



  @Override
  public int read() throws IOException {
    return file.read();
  }

  public synchronized int available() {
    return (int)(file.size() - file.position());
  }

  @Override
  public void close() throws IOException {
    super.close();
    file.close();
  }
}
